//南航明珠商城-商品销售统计-销量.js
function search() {
	var productId = document.getElementsByName("productQo.prodId")[0].value;

	var startDate = $('#startDate').val();
	var endDate = $('#endDate').val();

	if (productId != '' && isNaN(productId)) {
		layer.alert("输入的商品编号有误，请重新输入！");
		return;
	}
	if ((startDate.length != 0 && startDate != '')
			&& (endDate.length != 0 && endDate != '')) {
		var startTime1 = startDate.slice(0, 4) + startDate.slice(5, 7)
				+ startDate.slice(8, 10);
		var endTime1 = endDate.slice(0, 4) + endDate.slice(5, 7)
				+ endDate.slice(8, 10);
		var timeValue1 = endTime1 - startTime1;
		if (timeValue1 < 0) {
			layer.alert("结束时间必须大于或等于开始时间!");
			return;
		}
	}
    $("#page").val("1");
    $("#search_form").submit();
}
function toIsEmpty() {
	document.getElementsByName("productQo.prodId")[0].value = "";
	document.getElementsByName("productQo.proName")[0].value = "";
	$('#startDate').val("");
	$('#endDate').val("");
}
function slimport(){
   var url=$("#search_form").attr("action");
   $("#search_form").attr("action",path+"/product_sale_analytics/sale_export").submit(); 
   $("#search_form").attr("action",url);
}
function detail(id){
	var startTime = $('#startDate').val();
	var endTime = $('#endDate').val();
	$("#exportIframe").attr("src", path + "/product_sale_analytics/order_list_excel?productId="+id+"&startTime="+startTime+"&endTime="+endTime)

}